package com.jic.order.api;

import com.alibaba.fastjson.JSONObject;
import com.jic.common.base.vo.RestResult;
import com.jic.order.request.ScoreOrderRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * name要调用的服务,这里相当于声明http地址, 比如预下单:http://.../feign/pay/prePayOrder
 */
@FeignClient(name = "jic-order", path = "/scoreOrder")
public interface ToScoreOrderApi {
    /**
     * 查询用户
     * @param
     * @return
     * 入参:
     * {
     *     "userId":"1234"
     * }
     */
    @PostMapping("/queryUser")
    RestResult<JSONObject> queryUser(@RequestBody ScoreOrderRequest scoreOrderRequest);
    /* 积分支付
     * @param
     * @return
     * 入参:
     * {
        "userId":"1234",
        "payAmount":"0.2"
}      }
     */
    @PostMapping("/scorePay")
    RestResult<JSONObject> scorePay(@RequestBody ScoreOrderRequest scoreOrderRequest);
    /**
     * 积分支付查询
     * @param
     * @return
     * 入参:
     * {
     *     "userId":"1234",
     *     "orderNo":"15c00a41b3e04ff1b0014ded3be482ce"
     * }
     */
    @PostMapping("/scorePayQuery")
    RestResult<JSONObject> scorePayQuery(@RequestBody ScoreOrderRequest scoreOrderRequest);
}
